<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
	<meta charset="UTF-8">
	<link rel="shortcut icon" href="favicon.ico">
	<link rel="stylesheet" href="css/iconfont.css">
	<link rel="stylesheet" href="css/global.css">
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/bootstrap-theme.min.css">
	<link rel="stylesheet" href="css/login.css">
	<script src="js/jquery.1.12.4.min.js" charset="UTF-8"></script>
	<script src="js/bootstrap.min.js" charset="UTF-8"></script>
	<script src="js/jquery.form.js" charset="UTF-8"></script>
	<script src="js/global.js" charset="UTF-8"></script>
	<script src="js/login.js" charset="UTF-8"></script>
	<script type="text/javascript" src="layer/layer.js"></script>
	<title>登录 / 注册</title>
</head>
<body>
	<div class="public-head-layout container">
		<a class="logo" href="index.html"><img src="images/icons/logo.jpg" alt="U袋网" class="cover"></a>
	</div>
	<div style="background:url(images/login_bg.jpg) no-repeat center center; ">
		<div class="login-layout container">
			<div class="form-box login">
				<div class="tabs-nav">
					<h2>欢迎登录广内殿</h2>
				</div>
				<div class="tabs_container">
					<form class="tabs_form" action="login" method="post" id="login_form">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<span class="glyphicon glyphicon-phone" aria-hidden="true">账号</span>
								</div>
								<input class="form-control" name="username" id="username"  placeholder="请输入账号"  type="text">
							</div>
						</div>
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<span class="glyphicon glyphicon-lock" aria-hidden="true">密码</span>
								</div>
								<input class="form-control password" name="password" id="password" placeholder="请输入密码" type="password">
								<div class="input-group-addon pwd-toggle" title="显示密码"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></div>
							</div>
						</div>
					
	                    <button class="btn btn-large btn-primary btn-lg btn-block submit" id="login_submit" onclick="dengLu()" type="button">登录</button><br>
	                    <button class="btn btn-large btn-primary btn-lg btn-block submit" type="button"> <a href="udai_modifypwd_step1.html" role="button" class="but">忘记登陆密码</a></button><br>
	                   
 
                    </form>
                </div>
			</div>
			
			
			<script>
				$(document).ready(function() {
					// 判断直接进入哪个页面 例如 login.php?p=register
					switch($.getUrlParam('p')) {						
						default: $('.login').show();
					};
				});
				function dengLu(){
					$.post("login",{
						username:$("#username").val(),
						password:$("#password").val()
					},function(res){
						console.log(res);
						if(res.code=="0"){
							var u=JSON.stringify(res.data);
							console.log(u);
							window.localStorage.setItem("user",u);
							window.location.href="index.html";
						} else {
							layer.msg("账号密码错误");
						}
					},"json");
				}
				
			</script>
		</div>
	</div>
	
</body>
</html>